// This function processes the quiz data
function hideCertificate()
{
	document.getElementById("certificate").style.display = "none";
}
function submitQuiz1()
{
	var numberCorrect = 0;
	var q1 = document.forms.quiz1.question1;
	var q2 = document.forms.quiz1.question2;
	var q3 = document.forms.quiz1.question3;
	var q4 = document.forms.quiz1.question4;
	var q5 = document.forms.quiz1.question5;
	var q6 = document.forms.quiz1.question6;
	
	if( q1[2].checked == true)
	{
		numberCorrect = numberCorrect + 1;
	}
	
	if( q2[0].checked == true)
		{
			numberCorrect = numberCorrect + 1;
		}
	
	if(q3[2].checked == true)
		{
			numberCorrect = numberCorrect + 1;
		}
	
	if(q4[1].checked == true)
		{
			numberCorrect = numberCorrect + 1;
		}
	
	if(q5[1].checked == true)
		{
			numberCorrect = numberCorrect + 1;
		}
	if(q6[0].checked == true)
		{
			numberCorrect = numberCorrect + 1;
		}

	var score = numberCorrect / 6 * 100;
	alert("Your score is " + score + "%");
	
	if(score >= 65)
		{
			alert("You passed!")
			document.getElementById("certificate").style.display = "inline";
		}
	
	if(score < 65)
		{
			alert("Try again.")
		}

	
	// call the function to report scores
	parent.reportScores();
}